package com.yangquan.ayuan.synchronizedTest;

/**
 * synchronized 对静态方法加锁
 * 锁住的是当前类对象，即 Class 对象
 */
public class SynchronizedStaticMethodExample {
    public static synchronized void staticMethod() {
        System.out.println("Static synchronized method");
    }

    public static void main(String[] args) {
        SynchronizedInstanceMethodExample instanceMethodExample = new SynchronizedInstanceMethodExample();
        instanceMethodExample.instanceMethod();
    }
}